var stdPostHeader = {
    save: {
        method: 'POST'
    }
};

angular.module('mis.weixinManager.weixinService', ['ngResource'])
    .factory('Weixin', function ($resource) {
        //var weixinHost = AppHost;
        //var weixinHost = backOfficeHost;
        var weixinHost = "t-app-66xiaoqu.babytree.com";
        return {
            getUserProfile: function(openId, callback){
                var req = $resource('http://{0}/rest/v1.0/wechat/userProfile'.format(weixinHost), {}, stdPostHeader);
                req.save({openId:openId}, function (data) {
                    callback(data.result.message, data.data);
                })
            }
        }
    })
;
